TARG = recvd sendc recvd_tester sendc_tester shm2file sendc-dev
BINDIR = /usr/local/pem/bin
CC = gcc46
LD = gcc46
CFLAGS = -c -Wall
LDFLAGS =
#
.ifdef DEBUG
CFLAGS += -g
.else
CFLAGS += -s -fomit-frame-pointer -O3 
.endif
#
#
.PHONY: clean all deinstall

.SUFFIXES:
.SUFFIXES: .o  .c

all: $(TARG)

.c.o:
	$(CC) $(CFLAGS) $<

sendc_tester: sendc_tester.o
	$(LD) $(LDFLAGS) $(.ALLSRC) -o sendc_tester

recvd:	recvd.o
	$(LD) $(LDFLAGS) $(.ALLSRC) -o recvd

recvd_tester:	recvd_tester.o
	$(LD) $(LDFLAGS) $(.ALLSRC) -o recvd_tester

sendc:	sendc.o
	$(LD) $(LDFLAGS) $(.ALLSRC) -o sendc
sendc-dev:	sendc-dev.o
	$(LD) $(LDFLAGS) $(.ALLSRC) -o sendc-dev

shm2file: shm2file.o
	$(LD) $(LDFLAGS) $(.ALLSRC) -o shm2file

clean:
	rm -f *.o *.*~ *.core 
	rm -f recvd sendc recvd_tester sendc_tester shm2file

install: $(TARG)
	cp -pRf $(TARG) $(BINDIR)
